﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Warehouse.Infrstructre.Migrations
{
    /// <inheritdoc />
    public partial class 仓库 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Allocates",
                columns: table => new
                {
                    AllocateId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    AllocateCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AllocateStore = table.Column<int>(type: "int", nullable: true),
                    MorderNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MakePerson = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MarkTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ARremark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AllocateState = table.Column<int>(type: "int", nullable: true),
                    IsAllocate = table.Column<bool>(type: "bit", nullable: true),
                    office_id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    user_id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Allocates", x => x.AllocateId);
                });

            migrationBuilder.CreateTable(
                name: "AllProducts",
                columns: table => new
                {
                    AllProductId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ProductsID = table.Column<int>(type: "int", nullable: true),
                    AllocateId = table.Column<int>(type: "int", nullable: true),
                    AllProductNum = table.Column<int>(type: "int", nullable: true),
                    office_id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    user_id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AllProducts", x => x.AllProductId);
                });

            migrationBuilder.CreateTable(
                name: "Injures",
                columns: table => new
                {
                    InjureId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    InjureCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InjureType = table.Column<int>(type: "int", nullable: true),
                    MorderNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MakePerson = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MarkTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    InjureStart = table.Column<int>(type: "int", nullable: true),
                    office_id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    user_id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Injures", x => x.InjureId);
                });

            migrationBuilder.CreateTable(
                name: "InProducts",
                columns: table => new
                {
                    InProductId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ProductId = table.Column<int>(type: "int", nullable: true),
                    InjureId = table.Column<int>(type: "int", nullable: true),
                    InjureNum = table.Column<int>(type: "int", nullable: true),
                    office_id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    user_id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_InProducts", x => x.InProductId);
                });

            migrationBuilder.CreateTable(
                name: "Inventorys",
                columns: table => new
                {
                    InventoryId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    InventoryCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MorderNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MakePerson = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MarkTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IRremark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InventoryState = table.Column<int>(type: "int", nullable: true),
                    InventoryType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    office_id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    user_id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Inventorys", x => x.InventoryId);
                });

            migrationBuilder.CreateTable(
                name: "Movelibrarys",
                columns: table => new
                {
                    MovelibraryId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MovelibraryCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MovelibraryType = table.Column<int>(type: "int", nullable: true),
                    MorderNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MakePerson = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MarkTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ORremark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsRemoved = table.Column<bool>(type: "bit", nullable: true),
                    office_id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    user_id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Movelibrarys", x => x.MovelibraryId);
                });

            migrationBuilder.CreateTable(
                name: "MoveProducts",
                columns: table => new
                {
                    MoveProductId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MovelibraryId = table.Column<int>(type: "int", nullable: true),
                    ProductsID = table.Column<int>(type: "int", nullable: true),
                    MoveProductNum = table.Column<int>(type: "int", nullable: true),
                    Movelocation = table.Column<int>(type: "int", nullable: true),
                    office_id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    user_id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MoveProducts", x => x.MoveProductId);
                });

            migrationBuilder.CreateTable(
                name: "OutProducts",
                columns: table => new
                {
                    OutProuductId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OutShipId = table.Column<int>(type: "int", nullable: true),
                    ProductsID = table.Column<int>(type: "int", nullable: true),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OutPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    OutProuductNum = table.Column<int>(type: "int", nullable: true),
                    Binlocation = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    office_id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    user_id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_OutProducts", x => x.OutProuductId);
                });

            migrationBuilder.CreateTable(
                name: "OutShips",
                columns: table => new
                {
                    OutShipId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OutShipCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OutShipType = table.Column<int>(type: "int", nullable: true),
                    OrderNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VendorId = table.Column<int>(type: "int", nullable: true),
                    VendorName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VendorContact = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VendorPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MakePerson = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MarkTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ORremark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SalesId = table.Column<int>(type: "int", nullable: true),
                    office_id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    user_id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_OutShips", x => x.OutShipId);
                });

            migrationBuilder.CreateTable(
                name: "StockProductss",
                columns: table => new
                {
                    StockProductId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    StockId = table.Column<int>(type: "int", nullable: true),
                    ProductsID = table.Column<int>(type: "int", nullable: true),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sprice = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Quantity = table.Column<int>(type: "int", nullable: true),
                    Binlocation = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    office_id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    user_id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_StockProductss", x => x.StockProductId);
                });

            migrationBuilder.CreateTable(
                name: "StockRooms",
                columns: table => new
                {
                    StockId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    StockCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StockOrderType = table.Column<int>(type: "int", nullable: true),
                    SorderNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VendorId = table.Column<int>(type: "int", nullable: true),
                    VendorName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VendorContact = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VendorPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MakePerson = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MarkTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SRremark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    office_id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    user_id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_StockRooms", x => x.StockId);
                });

            migrationBuilder.CreateTable(
                name: "StoreHouses",
                columns: table => new
                {
                    StorehouseId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    StorehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StorehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StorehouseType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseId = table.Column<int>(type: "int", nullable: true),
                    IsDisable = table.Column<bool>(type: "bit", nullable: true),
                    IsDefaults = table.Column<bool>(type: "bit", nullable: true),
                    CreatTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Sremark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    office_id = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    user_id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_StoreHouses", x => x.StorehouseId);
                });

            migrationBuilder.CreateTable(
                name: "Warehouseinfos",
                columns: table => new
                {
                    WarehouseId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RentalTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    WarehouseType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Department = table.Column<int>(type: "int", nullable: true),
                    IsDisable = table.Column<bool>(type: "bit", nullable: true),
                    IsDefaults = table.Column<bool>(type: "bit", nullable: true),
                    Waddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Area = table.Column<int>(type: "int", nullable: true),
                    Wcontact = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Wphone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Function = table.Column<int>(type: "int", nullable: true),
                    office_id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    user_id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Warehouseinfos", x => x.WarehouseId);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Allocates");

            migrationBuilder.DropTable(
                name: "AllProducts");

            migrationBuilder.DropTable(
                name: "Injures");

            migrationBuilder.DropTable(
                name: "InProducts");

            migrationBuilder.DropTable(
                name: "Inventorys");

            migrationBuilder.DropTable(
                name: "Movelibrarys");

            migrationBuilder.DropTable(
                name: "MoveProducts");

            migrationBuilder.DropTable(
                name: "OutProducts");

            migrationBuilder.DropTable(
                name: "OutShips");

            migrationBuilder.DropTable(
                name: "StockProductss");

            migrationBuilder.DropTable(
                name: "StockRooms");

            migrationBuilder.DropTable(
                name: "StoreHouses");

            migrationBuilder.DropTable(
                name: "Warehouseinfos");
        }
    }
}
